package dto

import (
	"hc-admin/app/admin/models"
	"hc-admin/common/dto"
	common "hc-admin/common/models"
)

type BusDepositProofGetPageReq struct {
	dto.Pagination `search:"-"`
	FullName       string `form:"fullName"  search:"type:exact;column:full_name;table:bus_deposit_proof" comment:"客戶英文全名"`
	IdCard         string `form:"idCard"  search:"type:exact;column:id_card;table:bus_deposit_proof" comment:"客戶身分證號碼"`
	BusDepositProofOrder
}

type BusDepositProofOrder struct {
	Id        string `form:"idOrder"  search:"type:order;column:id;table:bus_deposit_proof"`
	FullName  string `form:"fullNameOrder"  search:"type:order;column:full_name;table:bus_deposit_proof"`
	IdCard    string `form:"idCardOrder"  search:"type:order;column:id_card;table:bus_deposit_proof"`
	FilePath  string `form:"filePathOrder"  search:"type:order;column:file_path;table:bus_deposit_proof"`
	Status    string `form:"statusOrder"  search:"type:order;column:status;table:bus_deposit_proof"`
	CreateBy  string `form:"createByOrder"  search:"type:order;column:create_by;table:bus_deposit_proof"`
	UpdateBy  string `form:"updateByOrder"  search:"type:order;column:update_by;table:bus_deposit_proof"`
	CreatedAt string `form:"createdAtOrder"  search:"type:order;column:created_at;table:bus_deposit_proof"`
	UpdatedAt string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:bus_deposit_proof"`
	DeletedAt string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:bus_deposit_proof"`
}

func (m *BusDepositProofGetPageReq) GetNeedSearch() interface{} {
	return *m
}

type BusDepositProofInsertReq struct {
	Id       int    `json:"-" comment:""` //
	FullName string `json:"fullName" comment:"客戶英文全名"`
	IdCard   string `json:"idCard" comment:"客戶身分證號碼"`
	FilePath string `json:"filePath" comment:"上傳收據文件地址"`
	Status   string `json:"status" comment:"状态"`
	common.ControlBy
}

func (s *BusDepositProofInsertReq) Generate(model *models.BusDepositProof) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.FullName = s.FullName
	model.IdCard = s.IdCard
	model.FilePath = s.FilePath
	model.Status = s.Status
	model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

func (s *BusDepositProofInsertReq) GetId() interface{} {
	return s.Id
}

type BusDepositProofUpdateReq struct {
	Id       int    `uri:"id" comment:""` //
	FullName string `json:"fullName" comment:"客戶英文全名"`
	IdCard   string `json:"idCard" comment:"客戶身分證號碼"`
	FilePath string `json:"filePath" comment:"上傳收據文件地址"`
	Status   string `json:"status" comment:"状态"`
	common.ControlBy
}

func (s *BusDepositProofUpdateReq) Generate(model *models.BusDepositProof) {
	if s.Id == 0 {
		model.Model = common.Model{Id: s.Id}
	}
	model.FullName = s.FullName
	model.IdCard = s.IdCard
	model.FilePath = s.FilePath
	model.Status = s.Status
	model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

func (s *BusDepositProofUpdateReq) GetId() interface{} {
	return s.Id
}

// BusDepositProofGetReq 功能获取请求参数
type BusDepositProofGetReq struct {
	Id int `uri:"id"`
}

func (s *BusDepositProofGetReq) GetId() interface{} {
	return s.Id
}

// BusDepositProofDeleteReq 功能删除请求参数
type BusDepositProofDeleteReq struct {
	Ids []int `json:"ids"`
}

func (s *BusDepositProofDeleteReq) GetId() interface{} {
	return s.Ids
}
